package classes

import (
	"github.com/gin-gonic/gin"
	"goft/src/goft"
)

type UserClass struct { //这一步我们手写
	// *goft.GormAdapter  //注入Gorm,无需手动赋值
	*goft.GormAdapter             //注入XOrm,无需手动赋值
	Age               *goft.Value `prefix:"user.age"` // Value注解，用于读取配置文件。无需手动赋值
}

func NewUserClass() *UserClass {
	return &UserClass{}
}
func (this *UserClass) UserTest(ctx *gin.Context) string {
	return "测试" + this.Age.String()
}

func (this *UserClass) Build(goft *goft.Goft) { //这个参数是关键， 我们把goft传进来
	goft.Handle("GET", "/test", this.UserTest)
}
